package com.headwind.logistics.system.mapper;

import com.headwind.logistics.common.pojo.Customer;
import com.headwind.logistics.common.pojo.Employee;
import com.headwind.logistics.system.dto.WorkOrderEmployeeUseDto;
import com.headwind.logistics.system.pojo.WorkOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 桂祥宇
 * @Date 2020/7/26 0026 15:09
 * @Version 1.0
 * @DESCRIPTION 工单数据访问层
 */
public interface WorkOrderMapper {

    /**
     * 查询所有工单
     * @param page 页码
     * @param rows 行数
     * @return
     */
    public List<WorkOrderEmployeeUseDto> queryAllWorkOrderEmployeeUseDto(@Param("page") Integer page, @Param("rows") Integer rows);

    /**
     * 根据id删除工单
     * @param workOrderId 工单id
     * @return
     */
    public int deleteWorkOrder(int workOrderId);

    /**
     * 根据id查询客户姓名和电话号码
     * @param id 客户id
     * @return
     */
    public Customer queryAllCustomerid(int id);

    /**
     * 新增工单
     * @param workOrder 工单对象
     * @return
     */
    public int addWorkOrder(WorkOrder workOrder);

    /**
     * 查询所有员工号和员工名字
     * @return
     */
    public List<Employee> queryAllEmployees();

    /**
     * 修改工单
     * @param workOrder
     * @return
     */
    public int updateWorkOrder(WorkOrder workOrder);
}
